package Demo;

import java.util.Arrays;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
@SuppressWarnings ("all")
public class Demo96 {
    public static void main (String[] args) {
      Set<Integer> all= new CopyOnWriteArraySet();
        for (int i = 0; i <10 ; i++) {
            new Thread (()->{
                all.add (1);
                System.out.println (Arrays.toString (all.toArray ()));
            }).start ();
        }

    }
}
